package com.kk.base.entity.home;

import com.kk.base.annotion.ValidateEntity;
import com.kk.base.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;


/**
 * 网点申请实体类
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name="branch_apply_for")
@EntityListeners(AuditingEntityListener.class)
@ToString
@Data
public class BranchApplyFor extends BaseEntity {

    @ManyToOne
    @JoinColumn(name="home_user_id")
    private HomeUser homeUser;  //所属前台用户

    @ValidateEntity(required=true,errorRequiredMsg="网点名称不能为空!")
    @Column(name="branch_name",nullable=false)
    private String branchName; //网点名称

    @ValidateEntity(required=true,errorRequiredMsg="网点类型不能为空!")
    @Column(name="branch_type",nullable=false)
    private BranchTypeEnum branchType;  //网点类型

    @ValidateEntity(required=true,errorRequiredMsg="管理员姓名不能为空!")
    @Column(name="admin_name",nullable=false)
    private String adminName; //管理员姓名

    @ValidateEntity(required=true,errorRequiredMsg="身份证号不能为空!")
    @Column(name="id_card",nullable=false)
    private String idCard; //身份证号

    @ValidateEntity(required=true,errorRequiredMsg="手机号不能为空!")
    @Column(name="mobile",nullable=false)
    private String mobile;//手机号

    @ValidateEntity(required=true,errorRequiredMsg="手机号不能为空!")
    @Column(name="query_phone",nullable=false)
    private String queryPhone; //查询电话

    @ValidateEntity(required=true,errorRequiredMsg="省市区地址不能为空!")
    @Column(name="address",nullable=false)
    private String address; //（省市区）地址

    @ValidateEntity(required=true,errorRequiredMsg="办公地址不能为空!")
    @Column(name="office_address",nullable=false)
    private String officeAddress; //办公地址

    @ValidateEntity(required=true,errorRequiredMsg="经纬度不能为空!")
    @Column(name="longitude_and_latitude",nullable=false)
    private String longitudeAndIatitude;  // 百度地图经纬度

    @Column(name="branch_apply_for_status",nullable=false)
    private BranchApplyForStatusEnum branchApplyForStatus; //网点申请状态

    @Column(name="reject_reason")
    private String rejectReason ; //驳回原因




}
